package com.jsp.login.dao;

import java.util.List;

import com.vo.Person;

public class LoginDao {
	public boolean login(String email, String password) {
		boolean boo = false;
		List<Person> persons = Person.dao
				.find("select p.email from person p where p.email = '" + email
						+ "' and p.password = '" + password
						+ "' and p.iflock = 1");
		if (persons.size() > 0) {
			boo = true;
		}
		return boo;
	}

	public Person getPerson(String email) {
		List<Person> persons = Person.dao
				.find("select p.address, p.contacts, p.email, p.herolist, p.huge, p.id, p.idcard, p.name, p.phone, p.qq, p.webName, p.website from person p where p.email = '"
						+ email + "'");
		return persons.get(0);
	}

	public boolean Logrecord(com.vo.Logrecord log) {
		boolean boo = log.save();
		return boo;
	}
}
